#include "patientwindow.h"
#include "ui_patientwindow.h"

PatientWindow::PatientWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::PatientWindow)
{
    ui->setupUi(this);
    //this->setWindowTitle("患者窗口");

    chat.setCurrentMode(patient);

    ui->stackedWidget->addWidget(&information);
    ui->stackedWidget->addWidget(&patientUpload);
    ui->stackedWidget->addWidget(&diagnosis);
    ui->stackedWidget->addWidget(&chat);

    btnGroup.addButton(ui->toolButton_info, 0);
    btnGroup.addButton(ui->toolButton_upload, 1);
    btnGroup.addButton(ui->toolButton_query, 2);
    btnGroup.addButton(ui->toolButton_chat, 3);
    connect(&btnGroup, QOverload<int>::of(&QButtonGroup::buttonClicked), ui->stackedWidget, &QStackedWidget::setCurrentIndex);

    btnGroup.button(0)->setChecked(true);
    ui->stackedWidget->setCurrentIndex(0);
}

PatientWindow::~PatientWindow()
{
    delete ui;
}
